﻿using System;
using System.Collections.Generic;
using System.Configuration;
using FunctionalCLR.Core;
using FunctionalCLR.Core.Function;
using Zove.Compiler;

namespace Zove.Runtime {
    public class ZoveFunctionManager : DefaultFunctionManager {

        public override FuncNode Get(string functionName) {
            FuncNode fn = base.Get(functionName);

            if (fn == null) {
                string className = string.Empty;
                int index = functionName.IndexOf('.');
                if (index > 0) {
                    className = functionName.Substring(0, index);
                    functionName = functionName.Substring(
                        index + 1, functionName.Length - index - 1);
                    ZoomClass zvc
                        = ZoveDependencyManager.Instance.ClassLoader.Load(className);
                    fn = base.Get(functionName);
                }
            }

            return fn;
        }
    }
}
